<?=$system_message;?>
<input type="hidden" name="current_url" value="<?=$current_url;?>">
<div class="row">
	<div class="btn-group">
		<a href="<?=site_url('');?>" class="btn btn-success btn-small">Exit</a>
		<a href="<?=site_url('calendar/school');?>" class="btn btn-small">School Calendar</a>
		<a href="<?=site_url('calendar/section');?>" class="btn btn-small">Section Calendar</a>
		<a href="<?=site_url('calendar/academic');?>" class="btn btn-small">Academic Calendar</a>
		<a href="" class="btn btn-small btn-inverse">EDIT EVENT</a>
	</div>
	<hr class="clearfix">
</div>

<?if($event):

$from = new DateTime($event->event_start);
$end = new DateTime($event->event_end);
$end->modify('-1 Day');

?>
	<div>
	  <h2>Edit Event.</h2>
	  	<form action="<?=site_url('calendar/editevent/'.$batch_id);?>" method="POST">
		<div class="row">
			<div class="large-6 columns">
				<label class="label label-info">Start of Event</label>
				<input type="text" name="evt_str" class="datepicker3" value="<?=$from->format('m/d/Y');?>">
			</div>
			<div class="large-6 columns">
				<label class="label label-info">End Of Event</label>
				<input type="text" name="evt_end" class="datepicker3" value="<?=$end->format('m/d/Y');?>">
			</div>
		</div>

		<div class="row">
			<div class="large-6 columns">
				<label class="label label-info">Name of Event</label>
				<input type="text" name="evt_nme" value="<?=$event->event_name;?>">
			</div>
			<div class="large-6 columns">
				<label class="label label-info">Description/other message</label>
				<textarea name="evt_desc" style="min-height:200px;"><?=$event->event_desc;?></textarea>
			</div>
		</div>

		<div class="row">
			<div class="large-12 columns">
				<label class="label label-info">Color</label>
				<br>
				<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="" <?=$event->event_col == '' ? 'checked' : '';?>>&nbsp;<a href="#" class="btn btn-mini">Default Color</a></span>
				<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-primary" <?=$event->event_col == 'btn-primary' ? 'checked' : '';?>>&nbsp;<a href="#" class="btn btn-mini btn-primary">Color 1</a></span>
				<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-info" <?=$event->event_col == 'btn-info' ? 'checked' : '';?>>&nbsp;<a href="#" class="btn btn-mini btn-info">color 2</a></span>
				<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-success" <?=$event->event_col == 'btn-success' ? 'checked' : '';?>>&nbsp;<a href="#" class="btn btn-mini btn-success">color 3</a></span>
				<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-warning" <?=$event->event_col == 'btn-warning' ? 'checked' : '';?>>&nbsp;<a href="#" class="btn btn-mini btn-warning">color 4</a></span>
				<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-danger" <?=$event->event_col == 'btn-danger' ? 'checked' : '';?>>&nbsp;<a href="#" class="btn btn-mini btn-danger">color 5</a></span>
				<span style="display:inline-block;padding:5px;"><input type="radio" name="evt_col" value="btn-inverse" <?=$event->event_col == 'btn-inverse' ? 'checked' : '';?>>&nbsp;<a href="#" class="btn btn-mini btn-inverse">color 6</a></span>
			</div>
		</div>
		<hr>
		<input type="hidden" name="batch_sos" value="<?=$batch_id;?>">
		<input type="submit" name="edit_this_event_right_now" class="btn btn-primary" value="Save Changes">
		</form>
	</div>
<?else:?>
	<div class="alert-box">Event Not Found in Database.</div>
<?endif;?>